Program Transformation with Scoped Dynamic Rewrite Rules

نویسندگان

  • Martin Bravenboer
  • Arthur van Dam
  • Karina Olmos
  • Eelco Visser
چکیده

The applicability of term rewriting to program transformation is limited by the lack of control over rule application and by the context-free nature of rewrite rules. The first problem is addressed by languages supporting user-definable rewriting strategies. The second problem is addressed by the extension of rewriting strategies with scoped dynamic rewrite rules. Dynamic rules are defined at run-time and can access variables available from their definition context. Rules defined within a rule scope are automatically retracted at the end of that scope. In this paper we explore the design space of dynamic rules, their application to transformation problems, and their implementation. The technique is formally defined by extending the operational semantics underlying the program transformation language Stratego, and illustrated by means of several program tranformations in Stratego, including constant propagation, bound variable renaming, dead code elimination, function inlining, and function specialization.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Stratego/XT 0.17. A language and toolset for program transformation

Stratego/XT is a language and toolset for program transformation. The Stratego language provides rewrite rules for expressing basic transformations, programmable rewriting strategies for controlling the application of rules, concrete syntax for expressing the patterns of rules in the syntax of the object language, and dynamic rewrite rules for expressing context-sensitive transformations, thus ...

متن کامل

Scoped Dynamic Rewrite Rules

ion Generate new variable name and renaming rule for variables: NewVar : x -> y where new => y ; rules(RenameVar : Var(x) -> Var(y)) Can be used in renaming of many binding constructs.

متن کامل

Rewriting Strategies for Instruction Selection

Instruction selection (mapping IR trees to machine instructions) can be expressed by means of rewrite rules. Typically, such sets of rewrite rules are highly ambiguous. Therefore, standard rewriting engines based on fixed, exhaustive strategies are not appropriate for the execution of instruction selection. Code generator generators use special purpose implementations employing dynamic programm...

متن کامل

Composing Source-to-Source Data-Flow Transformations with Rewriting Strategies and Dependent Dynamic Rewrite Rules

Data-flow transformations used in optimizing compilers are also useful in other programming tools such as code generators, aspect weavers, domainspecific optimizers, and refactoring tools. These applications require source-tosource transformations rather than transformations on a low-level intermediate representation. In this paper we describe the composition of source-to-source data-flow trans...

متن کامل

A Survey of Rewriting Strategies in Program Transformation Systems∗

Program transformation is used in a wide range of applications including compiler construction, optimization, program synthesis, refactoring, software renovation, and reverse engineering. In the realization of a program transformation system for a certain type of transformation, design choices must be made regarding the representation of programs and the paradigm for implementation of transform...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Fundam. Inform.

دوره 69  شماره 

صفحات  -

تاریخ انتشار 2006